package it.unisalento.appsalento.activity;

import it.unisalento.appsalento.activity.fragment.CalendarioFragment;
import it.unisalento.appsalento.activity.fragment.HomeFragment;
import it.unisalento.appsalento.activity.fragment.LibrettoFragment;
import it.unisalento.appsalento.activity.fragment.RisultatiFragment;
import it.unisalento.appsalento.bo.mock.MockBo;
import it.unisalento.appsalento.model.Appello;
import it.unisalento.appsalento.model.Esame;
import it.unisalento.appsalento.model.Utente;

import java.util.ArrayList;
import java.util.List;

import android.app.Activity;
import android.app.Application;
import android.app.Fragment;
import android.content.Context;

/**
 * <b>Description:</b>Classe contenente i dati da mantenere in sessione
 * 
 * @author AGM
 */
public class App extends Application {
	public static MockBo mockBo;
	public static Utente utente;
	public static List<Appello> appelli;
	public static ArrayList<Appello> appelliForDay;
	public static ArrayList<Esame> listaEsami;
	public static HomeFragment homeFragment;
	public static LibrettoFragment librettoFragment;
	public static CalendarioFragment calendarioFragment;
	public static Fragment dettaglioEsameFragment;
	public static RisultatiFragment risultatiFragment;
	public static Esame esameCorrente;
	public static Appello dettaglioAppello;
	
	private static Context context;
	private static Activity activity;
	
	@Override
	public void onCreate() {
		super.onCreate();
		App.context = getApplicationContext();
		appelli = new ArrayList<Appello>();
		listaEsami = new ArrayList<Esame>();
		appelliForDay = new ArrayList<Appello>();
	}

	public synchronized static Context getAppContext() {
	    return App.context;
	}
	public static void setCurrentActivity(Activity currentActivity) {
	    activity = currentActivity;
	}

	public static Activity currentActivity() {
	    return activity;
	}
}
